<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let url = 'https://www.baidu.com/m?f=8&ie=utf-8&rsv_bp=1&tn=monline_3_dg&wd=session&name=呼呼呼'
        let urlEncoded = encodeURI(url)
        function getUrlKey(url) {
            let queryObj = {}
            if(url.indexOf('?') < 0) return queryObj
            let arr = url.split('?')
            url = arr[1]
            console.log(url);
            let array = url.split("&")
            for(let i = 0; i < array.length; i++) {
                let temp = array[i].split('=')
                queryObj[temp[0]] = temp[1]
            }
            return queryObj
        }
        console.log(getUrlKey(urlEncoded));
    </script>
</body>
</html>